package Java.BlackHorse.File;

import java.io.File;
import java.text.SimpleDateFormat;

public class FileDemo3 {
    /*
    * public long length() 返回字节大小
    * 1. 无法获取文件夹的大小
    * 2. 单位是 字节
    * public String getAbsolutePath()
    * public String getPath()
    * public String getName()
    * public long lastModified()
    * */
    public static void main(String[] args) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd : hh-mm-ss");

        File f1 = new File("File\\aaa\\b.txt");
        System.out.println(f1.length());
        System.out.println(f1.getAbsoluteFile());
        System.out.println(f1.getPath());
        System.out.println(f1.getName());
        System.out.println(sdf.format(f1.lastModified()));

    }
}
